package com.yuyou.activity.group.service.vo.resp;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.io.UnsupportedEncodingException;
import java.util.Date;

/**
 * 后台订单列表实体类
 */
public class RespActivityGroupBuyOrderListVo {

    @ApiModelProperty(example = "projectCode")
    private String projectCode ;
    
    @ApiModelProperty(example = "订单ID")
    private Long id ;

    @ApiModelProperty(example = "订单编号")
    private String orderId;
  
    @ApiModelProperty(example = "类型：0：团主，1：团员")
    private String type;
    
    @ApiModelProperty(example = "姓名")
    private String name;

    @ApiModelProperty(example = "手机号")
    private String phone;

    @ApiModelProperty(example = "商品名称")
    private String goodsName;

    @ApiModelProperty(example = "金额（单位：分）")
    private Long amount;

    @ApiModelProperty(example = "订单创建时间")
    private Date createTime;

    @ApiModelProperty(example = "支付状态：0：初始化，1：支付成功，2：支付失败，3：取消")
    private Integer payStatus;

    private String payStatusStr;

    @ApiModelProperty(example = "退款状态：null：无发起退款，0：初始化(已申请)，1：退款成功，2：退款失败")
    private Integer refundStatus;

    private String refundStatusStr;

    @ApiModelProperty(example = "退款时间，null时无退款")
    private Date refundTime;

    @ApiModelProperty(example = "团购类型")
    private Integer groupType;

    @ApiModelProperty(example = "团购类型")
    private String groupTypeStr;

    @ApiModelProperty(example = "退款订单号")
    private String refundId;

    @ApiModelProperty(example = "0：初始化，1：满标成功，2：差额成功，3，流失")
    private String status;

    @ApiModelProperty(example = "是否同步（shipin.com）:0：初始化，1: 待处理 ，2：同步成功，3：同步失败")
    private Integer isSync;

    @ApiModelProperty(example = "是否已通知:0:初始化，1：待处理，2：成功，3：失败")
    private Integer isNotice;

    @ApiModelProperty(example = "渠道")
    private String channel;

    @ApiModelProperty(example = "openId")
    private String openId;

    @ApiModelProperty(example = "微信名称")
    private String wxName;

    @ApiModelProperty(example = "微信头像")
    private String headImg;
    
    
    
    public String getProjectCode() {
		return projectCode;
	}

	public void setProjectCode(String projectCode) {
		this.projectCode = projectCode;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Long getAmount() {
        return amount;
    }

    public void setAmount(Long amount) {
        this.amount = amount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public Integer getRefundStatus() {
        return refundStatus;
    }

    public void setRefundStatus(Integer refundStatus) {
        this.refundStatus = refundStatus;
    }

    public Date getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public String getPayStatusStr() {
        String str;
        switch (this.getPayStatus()){
            case 0 : str = "未支付" ; break;
            case 1 : str = "支付成功" ; break;
            case 2 : str = "支付失败" ; break;
            case 3 : str = "取消" ; break;
            default: str = "未知" ; break;
        }

        return str;
    }

    public void setPayStatusStr(String payStatusStr) {
        this.payStatusStr = payStatusStr;
    }

    public Integer getGroupType() {
        return groupType;
    }

    public void setGroupType(Integer groupType) {
        this.groupType = groupType;
    }

    public String getGroupTypeStr() {
        String str;
        switch (this.getGroupType()){
            case 0 : str = "单人买" ; break;
            case 1 : str = "团购" ; break;
            default: str = "无" ; break;
        }

        return str;
    }

    public void setGroupTypeStr(String groupTypeStr) {
        this.groupTypeStr = groupTypeStr;
    }

    public String getRefundStatusStr() {
        //退款状态：null：无发起退款，0：初始化(已申请)，1：退款成功，2：退款失败
        String str;
        switch (this.getRefundStatus()){
            case 0 : str = "已申请" ; break;
            case 1 : str = "退款成功" ; break;
            case 2 : str = "退款失败" ; break;
            default: str = "" ; break;
        }

        return str;
    }

    public void setRefundStatusStr(String refundStatusStr) {
        this.refundStatusStr = refundStatusStr;
    }

    public String getRefundId() {
        return refundId;
    }

    public void setRefundId(String refundId) {
        this.refundId = refundId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    public Integer getIsSync() {
        return isSync;
    }

    public void setIsSync(Integer isSync) {
        this.isSync = isSync;
    }

    public Integer getIsNotice() {
        return isNotice;
    }

    public void setIsNotice(Integer isNotice) {
        this.isNotice = isNotice;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getWxName() {
        String n = "";
        if(StringUtils.isNotEmpty(wxName)){
            try {
                n = java.net.URLDecoder.decode(wxName, "utf-8");
            } catch (UnsupportedEncodingException e) {

            }
        }
        return n;
    }

    public void setWxName(String wxName) {
        this.wxName = wxName;
    }

    public String getHeadImg() {
        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }
}
